package com.example.event.DAO;

import com.example.event.Entity.EventEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by Studio on 2017/5/18.
 */
@Repository
public interface EventDAO extends JpaRepository<EventEntity,Integer>{

    @Query(value = "insert into event_0?(device_id,event,created) values(?,'offline',?)",nativeQuery = true)
    @Modifying
    @Transactional
    public int updateOnline0(int m,String device_id,long created);


    @Query(value = "insert into event_?(device_id,event,created) values(?,'offline',?)",nativeQuery = true)
    @Modifying
    @Transactional
    public int updateOnline1(int m,String device_id,long created);




}
